Redact absolute trace_path from public runtime decisions - #18
Merged
Conversation
The /api/runtime/decisions listing returned each decision's trace_path -- an absolute host path to the per-decision audit file (e.g. /var/lib/bpfcompat-demo/runtime-audit/decisions/<id>.json). That path is not retrievable via the API and discloses the server's workdir layout to anonymous readers on the public demo. Strip trace_path from the listing when BPFCOMPAT_API_REDACT_RUNTIME_DETAILS is set (the demo posture), consistent with the report sanitizer; operators with shell access can still read the file directly. Make the field omitempty so it drops cleanly. Adds a regression test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
While wiring up "prepared evidence" for the runtime Select/Fetch demo, I found
/api/runtime/decisionsleaked each record'strace_path— an absolute host path (/var/lib/bpfcompat-demo/runtime-audit/decisions/<id>.json) — to anonymous readers on the public demo. The path isn't retrievable via the API and discloses the server workdir layout.Fix
trace_pathfrom the decisions listing whenBPFCOMPAT_API_REDACT_RUNTIME_DETAILSis set (demo posture), consistent with the report sanitizer.trace_pathis nowomitemptyso it drops cleanly.Testing
TestRuntimeDecisionsRedactTracePath(redacted when on, present when off)go test ./internal/api/ ./internal/runtime/pass;go vetclean🤖 Generated with Claude Code